package com.hyg.idea;

import android.content.Context;

import com.hyg.common.CommonLibary;

/**
 * Author: zhpan
 * Date: 2022/5/5
 * Description: Utils初始化相关
 */
public class HttpLibrary {

    private static Context context;

    private HttpLibrary() {
        throw new UnsupportedOperationException("u can't instantiate me...");
    }

    /**
     * 初始化工具类
     *
     * @param context 上下文
     */
    public static void init(Context context) {
        HttpLibrary.context = context.getApplicationContext();
        CommonLibary.init(context);
    }

    /**
     * 获取ApplicationContext
     *
     * @return ApplicationContext
     */
    public static Context getContext() {
        if (context != null) return context;
        throw new NullPointerException("u should init first");
    }


}